import React from 'react'
import ReactDOM from "react-dom";
import {BrowserRouter as Router,Switch,Redirect, Route} from "react-router-dom";
import Home from '../views/Home.js'
import News from '../views/News.js'
import Course from '../views/Course.js'
import JoinUs from '../views/JoinUs.js'
import A from '../containers/A.js'
import advantage from '../containers/advantage.js'
import App from '../App';
import Login from '../views/account/Login'
import Store from '../components/testStore'
import UserInfo from "../views/user/UserInfo";
const BasicRoute = () => (
     <Router>
        <div>
            <Switch>
             {/*   <Route exact path="/">
                    <Login />
                </Route>*/}
                <Route exact path="/" component={Login} />
                <Route path="/Home" component={Home} />
                {/*<Route path="/userInfo" component={UserInfo} />*/}
                <Route path="/news" component={News}/>
                {/*<Route path="/news/:id" component={NewsDetail}/>*/}
                <Route path="/course" component={Course}/>
                <Route path="/joinUs" render={(props) => <JoinUs {...props}/>}/>
                <Route path="/error" render={(props) => <div><h1>404 Not Found!</h1></div>}/>
               {/* <Route path="*" render={(props) => <Redirect to='/error'/>}/>*/}
            </Switch>
        </div>
    </Router>
);


const routes = [
    {
        path: '/',
        component: App,
        exact: true,
    },
    {
        path: '/advantage',
        component: advantage,
        children: [
            {
                path: '/advantage/advantage1',
                component: A
            }
        ]
    },
    {
        path: '/Home',
        component: Home,
        exact: true,
    },   {
        path: '/store',
        component: Store,
        exact: true,
    },
]

export default BasicRoute ;


